<?php

/*
	This plugin works only in windows systems
*/
class plugin_browser
{
	const PLUGIN_NAME 			= 'Browser';
	const PLUGIN_DESCRIPTION 	= "Browser simulation from php"; 
	const NAME_CACHE 			= 'plugin_browser';
	const ICON 					= '';

	public function browse($url)
	{
	$Browser = new COM('InternetExplorer.Application') or die('Can\'t locate ie');
	$Browserhandle = $Browser->HWND;
	$Browser->Visible = true;
	$Browser->Fullscreen = true;
	$Browser->Width = 700;
	$Browser->height = 380;
	$Browser->resizable = false;
	$Browser->Navigate('http://skyul.com');
	//->outerhtml;

	while($Browser->Busy){
  		com_message_pump(4000);
	}

	//var_dump($Browser->Document->documentElement->outerhtml);
	sleep(2);
	/*$img = imagegrabwindow($Browserhandle, 0);*/
	$img = imagegrabwindow($Browserhandle, 0);
	$Browser->Quit();
	imagepng($img, 'screenshot.png');

	}
}
?>